<template>
  <div class="update-name">
    <!-- 导航栏 -->
    <van-nav-bar
      title="设置昵称"
      left-text="取消"
      right-text="完成"
      @click-left="$emit('close')"
      @click-right="onConfirm"
    />
    <!-- /导航栏 -->
    <!-- 输入框 -->
    <div class="field-wrap">
      <van-field
        v-model.trim="localName"
        rows="2"
        autosize
        type="textarea"
        maxlength="7"
        placeholder="请输入昵称"
        show-word-limit
      />
    </div>
    <!-- /输入框 -->
  </div>
</template>

<script>
export default {
  name: 'UpdateName',
  props: {
    userNickName: {
      type: String,
      required: true
    }
  }
}
</script>

<style scoped lang="less">
/deep/.van-nav-bar__text {
  color: #ffffff;
}
.field-wrap {
  padding: 20px;
}
</style>
